Full source code website bán hàng thương mại điện tử gần giống shopee
468.839 lượt xem;
1 <?php
2 mysql_connect("localhost","root","");
3 mysql_select_db("");
4 mysql_query("SET NAMES 'latin1'");
5
6 $id=$_REQUEST['id'];
7 $sql=mysql_query("SELECT * FROM user_shop where id='".$id."'");
8 $row=mysql_fetch_assoc($sql);
9 $caaaa1=mysql_query("SELECT * FROM city where id='".$row['city']."' ");
10 $cat_mem1=mysql_fetch_assoc($caaaa1);
11 ?>
12 <?php
13 date_default_timezone_set('Asia/Ho_Chi_Minh');
14
15 ?>
16 <html>
17
18 <head>
19 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
20 </head>
21 <body>
22 <style>
23 .left
24 {
25 float:left
26 }
27 .left input
28 {
29 width:250px;
30 }
31 </style>
32 <table><tr>
33
34 </tr></table>
35 <div>
36 <div class="left">
37 <div style="background-color:#8CA6EE;padding:10px">
38 Thông tin Shop
39 </div>
40 <form method="POST" action="">
41 <div style="">
42 <table>
43 <tr>
44 <td align="right"><p>ID: </td>
45 <td><input type="text" name="id" value="<?php echo $row['id'];?>"> </p></td>
46 </tr><tr>
47 <td align="right"><p>Tên đăng nhập: </td>
48 <td><input type="text" name="user" value="<?php echo $row['user'];?>"> (Phân biệt chữ HOA)</p></td>
49 </tr>
50
51 <tr>
52 <td align="right"><p>Loại Shop: </td>
53 <td>
54
55
56
57
58 <input type="text" style="width: 29px;" name="level_shop" value="<?php echo $row['level_shop'];?>"> (3 Shop Thường)-(0 Shop LỬA ĐỎ)
59
60
61 </p></td>
62 </tr>
63
64 <tr>
65 <td align="right"><p>Email: </td>
66 <td><input type="text" name="email" value="<?php echo $row['email'];?>"></p></td>
67 </tr>
68 <tr>
69 <td align="right"><p>Số điện thoại: </td>
70 <td><input type="text" name="phone" value="<?php echo $row['phone'];?>"></p></td>
71 </tr>
72 <tr>
73 <td align="right"><p>Địa chỉ : </td>
74 <td><input type="text" name="address" value="<?php echo $row['address'];?>"></p></td>
75 </tr>
76 </table>
77 </div>
78 </div>
79
80
81
82 <div style="float:right">
83 <div style="background-color:#8CA6EE;padding:10px">
84 Thông tin SHOP
85 </div>
86 <div style="">
87 <?php
88 if(isset($_POST['Save']))
89 {
90 $user=$_POST['user'];
91 $pass = ( md5(md5(md5( md5(md5(md5( addslashes($_POST['pass']))))))));
92 $level_shop=$_POST['level_shop'];
93
94
95 $email= $_POST['email'];
96 $phone= $_POST['phone'];
97 $address= $_POST['address'];
98 $company= $_POST['company'];
99 $city= $_POST['city'];
100 $visit= $_POST['visit'];
101 $tien=str_replace(",","",$_POST['tien']);
102 $active= $_POST['active'];
103 $re_time= $_POST['re_time'];
104
105
106
107
108
109
110
111
112
113
114 $sql="update user_shop set user='".$user."',pass='".$pass."',level_shop='".$level_shop."',email='".$email."',phone='".$phone."',address='".$address."',company='".$company."',city='".$city."',visit='".$visit."',tien='".$tien."',active='".$active."',re_time='".$re_time."' where id='".$id."'";
115 if(mysql_query($sql))
116 {
117 $err="<script>window.location='http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]."'</script>";
118 }
119 else
120 {
121 $err="Không thể cập nhật";
122 }
123
124
125 }
126
127
128 ?>
129
130 <table>
131 <tr>
132 <td align="right"></td>
133 <td><?php echo $err;?></td>
134 </tr>
135 <tr>
136 <tr>
137 <td align="right"><p>Tên Shop: </td>
138 <td><input type="text" name="company" value="<?php echo $row['company'];?>"></p></td>
139 </tr>
140 <tr>
141 <tr>
142 <td align="right"><p>Tỉnh thành: </td>
143 <td> <select name="city" style="width:173px">
144 <option value="<? echo $row['city'];?>" >Hiện tại: <? echo $cat_mem1['name'];?> </option>
145 <? $sql1=mysql_query("SELECT * FROM city");
146 while($row1=mysql_fetch_array($sql1))
147 {?>
148
149 <option value="<? echo $row1['id'];?>" ><? echo $row1['name'];?> </option>
150 <?}?>
151 </select></p></td>
152 </tr>
153 <tr>
154 <td align="right"><p>Lượt xem trang : </td>
155 <td><input type="text" name="visit" value="<? echo $row['visit']; ?>"></p></td>
156 </tr>
157 <tr>
158 <td align="right"><p>Ngân sách: </td>
159 <td><input type="text" name="tien" value="<? echo $row['tien']; ?>"></p>0 Active,1 Khóa</td>
160 </tr>
161 <tr>
162 <td align="right"><p>Trạng thái: </td>
163 <td><input type="text" name="active" value="<? echo $row['active']; ?>"></p></td>
164 </tr>
165 <tr>
166 <td align="right"><p>Ngày đăng ký: </td>
167 <td><input type="text" name="re_time" value="<? echo $row['re_time']; ?>"></p> </td>
168 </tr>
169
170
171 <td></p></td>
172 <tr>
173 <td></p></td>
174 <td><input type="submit" name="Save" value="Cập nhật"></p></td>
175 </tr>
176 </table>
177 </form>
178 </div>
179 </div>
180 </div>
181 </body>
182 </html>
2 mysql_connect("localhost","root","");
3 mysql_select_db("");
4 mysql_query("SET NAMES 'latin1'");
5
6 $id=$_REQUEST['id'];
7 $sql=mysql_query("SELECT * FROM user_shop where id='".$id."'");
8 $row=mysql_fetch_assoc($sql);
9 $caaaa1=mysql_query("SELECT * FROM city where id='".$row['city']."' ");
10 $cat_mem1=mysql_fetch_assoc($caaaa1);
11 ?>
12 <?php
13 date_default_timezone_set('Asia/Ho_Chi_Minh');
14
15 ?>
16 <html>
17
18 <head>
19 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
20 </head>
21 <body>
22 <style>
23 .left
24 {
25 float:left
26 }
27 .left input
28 {
29 width:250px;
30 }
31 </style>
32 <table><tr>
33
34 </tr></table>
35 <div>
36 <div class="left">
37 <div style="background-color:#8CA6EE;padding:10px">
38 Thông tin Shop
39 </div>
40 <form method="POST" action="">
41 <div style="">
42 <table>
43 <tr>
44 <td align="right"><p>ID: </td>
45 <td><input type="text" name="id" value="<?php echo $row['id'];?>"> </p></td>
46 </tr><tr>
47 <td align="right"><p>Tên đăng nhập: </td>
48 <td><input type="text" name="user" value="<?php echo $row['user'];?>"> (Phân biệt chữ HOA)</p></td>
49 </tr>
50
51 <tr>
52 <td align="right"><p>Loại Shop: </td>
53 <td>
54
55
56
57
58 <input type="text" style="width: 29px;" name="level_shop" value="<?php echo $row['level_shop'];?>"> (3 Shop Thường)-(0 Shop LỬA ĐỎ)
59
60
61 </p></td>
62 </tr>
63
64 <tr>
65 <td align="right"><p>Email: </td>
66 <td><input type="text" name="email" value="<?php echo $row['email'];?>"></p></td>
67 </tr>
68 <tr>
69 <td align="right"><p>Số điện thoại: </td>
70 <td><input type="text" name="phone" value="<?php echo $row['phone'];?>"></p></td>
71 </tr>
72 <tr>
73 <td align="right"><p>Địa chỉ : </td>
74 <td><input type="text" name="address" value="<?php echo $row['address'];?>"></p></td>
75 </tr>
76 </table>
77 </div>
78 </div>
79
80
81
82 <div style="float:right">
83 <div style="background-color:#8CA6EE;padding:10px">
84 Thông tin SHOP
85 </div>
86 <div style="">
87 <?php
88 if(isset($_POST['Save']))
89 {
90 $user=$_POST['user'];
91 $pass = ( md5(md5(md5( md5(md5(md5( addslashes($_POST['pass']))))))));
92 $level_shop=$_POST['level_shop'];
93
94
95 $email= $_POST['email'];
96 $phone= $_POST['phone'];
97 $address= $_POST['address'];
98 $company= $_POST['company'];
99 $city= $_POST['city'];
100 $visit= $_POST['visit'];
101 $tien=str_replace(",","",$_POST['tien']);
102 $active= $_POST['active'];
103 $re_time= $_POST['re_time'];
104
105
106
107
108
109
110
111
112
113
114 $sql="update user_shop set user='".$user."',pass='".$pass."',level_shop='".$level_shop."',email='".$email."',phone='".$phone."',address='".$address."',company='".$company."',city='".$city."',visit='".$visit."',tien='".$tien."',active='".$active."',re_time='".$re_time."' where id='".$id."'";
115 if(mysql_query($sql))
116 {
117 $err="<script>window.location='http://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]."'</script>";
118 }
119 else
120 {
121 $err="Không thể cập nhật";
122 }
123
124
125 }
126
127
128 ?>
129
130 <table>
131 <tr>
132 <td align="right"></td>
133 <td><?php echo $err;?></td>
134 </tr>
135 <tr>
136 <tr>
137 <td align="right"><p>Tên Shop: </td>
138 <td><input type="text" name="company" value="<?php echo $row['company'];?>"></p></td>
139 </tr>
140 <tr>
141 <tr>
142 <td align="right"><p>Tỉnh thành: </td>
143 <td> <select name="city" style="width:173px">
144 <option value="<? echo $row['city'];?>" >Hiện tại: <? echo $cat_mem1['name'];?> </option>
145 <? $sql1=mysql_query("SELECT * FROM city");
146 while($row1=mysql_fetch_array($sql1))
147 {?>
148
149 <option value="<? echo $row1['id'];?>" ><? echo $row1['name'];?> </option>
150 <?}?>
151 </select></p></td>
152 </tr>
153 <tr>
154 <td align="right"><p>Lượt xem trang : </td>
155 <td><input type="text" name="visit" value="<? echo $row['visit']; ?>"></p></td>
156 </tr>
157 <tr>
158 <td align="right"><p>Ngân sách: </td>
159 <td><input type="text" name="tien" value="<? echo $row['tien']; ?>"></p>0 Active,1 Khóa</td>
160 </tr>
161 <tr>
162 <td align="right"><p>Trạng thái: </td>
163 <td><input type="text" name="active" value="<? echo $row['active']; ?>"></p></td>
164 </tr>
165 <tr>
166 <td align="right"><p>Ngày đăng ký: </td>
167 <td><input type="text" name="re_time" value="<? echo $row['re_time']; ?>"></p> </td>
168 </tr>
169
170
171 <td></p></td>
172 <tr>
173 <td></p></td>
174 <td><input type="submit" name="Save" value="Cập nhật"></p></td>
175 </tr>
176 </table>
177 </form>
178 </div>
179 </div>
180 </div>
181 </body>
182 </html>